Page({
    data: {
        list: {},
        id: null,
        remark: "",
        page_loading: !0,
        is_reply: !1
    },
    onLoad: function(t) {
        var e = this, a = t.id;
        this.setData({
            id: a
        }), wx.showLoading({
            content: "加载中",
        }), getApp().request({
            url: getApp().api.admin.comment.detail,
            data: {
                id: a
            },
            method: "get",
            success: function(t) {
              wx.hideLoading()
              if ( 0 == t.code) {
                var a = t.data.list;
                // a.goods.attr = JSON.parse(a.goods.attr_groups);
                var n = !1;
                a.reply_content && (n = !0), e.setData({
                  list: a,
                  is_reply: n
                });
              } else wx.showToast({
                title: t.msg,
                icon: 'none'
              });
            },
            fail: function(t) {
              wx.showToast({
                title: t.msg,
                icon: 'none'
              });
            }
        });
    },
    input: function(t) {
        this.setData({
            remark: t.detail.value
        });
    },
    send: function() {
        if (0 == this.data.remark.length) return wx.showToast({
            title: "请填写回复内容",
            icon: 'none'
        }), !1;
        getApp().request({
            url: getApp().api.admin.comment.reply,
            data: {
                reply_content: this.data.remark,
                id: this.data.id
            },
            method: "post",
            success: function(t) {
              wx.hideLoading(), 0 == t.code ? (wx.showToast({
                title: "发布成功",
                icon: 'none'
              }), setTimeout(function () {
                wx.navigateBack();
              }, 1e3)) : wx.showToast({
                title: t.msg,
                icon: 'none'
              });
            },
            fail: function(t) {
              wx.showToast({
                title: t.msg,
                icon: 'none'
              });
            }

        });
    },
    onReady: function(t) {
        this.setData({
            page_loading: !1
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});